package net.huashitong.ssydt.provider.common.service;


import net.huashitong.ssydt.common.entity.vo.*;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.ui.Model;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.08.23
 */
@CacheConfig
public interface CommonService {
    /**
     * 获取省份列表
     *
     * @return
     */
    @Cacheable(cacheNames = "province")
    List<AreaVo> provinceList();

    @Cacheable(cacheNames = "city")
    List<AreaVo> cityList(String provinceId);

    @Cacheable(cacheNames = "county")
    List<AreaVo> countyList(String cityId);

    @Cacheable(cacheNames = "areas")
    List<AreasVo> areasList();

    /**
     * banner列表
     *
     * @return
     */
    List<CommonBannerVO> getBannerList();

    /**
     * 提交问题反馈
     *
     * @param feedbackVO
     * @param userId
     */
    void postFeedback(FeedbackVO feedbackVO, String userId);

    /**
     * 发起文章分享
     *
     * @param articleId
     * @param userId
     * @param request
     * @return
     */
    ShareOutVO getShareArticle(Long articleId, String userId, HttpServletRequest request);

    /**
     * 题目分享
     *
     * @param questionId
     * @param userId
     * @param request
     * @return
     */
    ShareOutVO getShareQuestion(Long questionId, String userId, HttpServletRequest request);

    /**
     * 测评报告分享
     *
     * @param type
     * @param recordId
     * @param userId
     * @param request
     * @return
     */
    ShareOutVO getShareExamReport(String type, Long recordId, String userId, HttpServletRequest request);

    /**
     * 统一分享跳转逻辑
     *
     * @param uuid
     * @param request
     * @return
     */
    String shareForward(String uuid, HttpServletRequest request);

    Model getShareArticlePage(HttpServletRequest request, Model model);

    Model getShareQuestionPage(HttpServletRequest request, Model model);

    Model getShareExamReportPage(HttpServletRequest request, Model model);

    /**
     * 获取公告
     *
     * @return
     * @param userId
     */
    NoticeVO getNotice(String userId);

    /**
     * 获取我的2017
     *
     * @param userId
     * @return
     */
    YearScoreVO getYearScore(String userId);
}
